<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>后台管理-商品添加</title>

    <meta name="keywords" content="{$Think.CONFIG.keywords}" />
    <meta name="description" content="{$Think.CONFIG.description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

    <include file="Public/head" />
</head>
<?php $Goods='active';$ptitle='商品管理';$title='商品添加';?>
<body class="no-skin">
<include file="Public/header" />
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>

    <include file="Public/sidebar" />
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs" />

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set" />

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <form action="{:U('add')}" method="post" class="ajax-form">
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="username"> 商品名称 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name='good_name' class="rcol-xs-10 col-sm-5" placeholder="商品名称" required>
                                    </div>
                                </div>
                                <div class="space-4"></div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="password"> 所属分类 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <select name="cate_id" class="rcol-xs-10 col-sm-5" required>
                                            <option value="">请选择</option>
                                            <volist name="cate" id="ca">
                                                <option value="{$ca.id}">{$ca.good_cate_name}</option>
                                            </volist>
                                        </select>
                                    </div>
                                </div>

                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="pwd"> 商品规格</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="grade" placeholder="商品规格" class="col-xs-10 col-sm-5">
                                    </div>
                                </div>

                                <div class="space-4"></div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="pwd"> 单价 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="price" placeholder="商品单价" class="col-xs-10 col-sm-5" required>
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="pwd"> 会员价 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="vip_price" placeholder="商品会员价" class="col-xs-10 col-sm-5" required>
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="pwd"> 包装长度 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="pack_length" placeholder="包装长度" class="col-xs-10 col-sm-5" required><span style="color:red;margin-left: 10px;">包装单位（{$pack_unit}）</span>
                                    </div>
                                </div>
                                <div class="space-4"></div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="pwd"> 包装宽度 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="pack_width" placeholder="包装宽度" class="col-xs-10 col-sm-5" required><span style="color:red;margin-left: 10px;">包装单位（{$pack_unit}）</span>
                                    </div>
                                </div>
                                <div class="space-4"></div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="pwd"> 包装高度 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="pack_height" placeholder="包装宽度" class="col-xs-10 col-sm-5" required><span style="color:red;margin-left: 10px;">包装单位（{$pack_unit}）</span>
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 安装费  </label>
                                    <div class="checkbox">
                                        <label>
                                            <input class="ace ace-checkbox-2" id="alone_install" name="alone_install" type="checkbox" value="1" />
                                            <span class="lbl" style="color:red;"> （点击勾选表示单独收取）</span>
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group" id="alone_install_price" style="display: none;">
                                    <label class="col-sm-1 control-label no-padding-right" for="pwd"> 单独安装费 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" id="install_price" name="alone_install_price" placeholder="单独安装费" class="col-xs-10 col-sm-5" >
                                    </div>
                                </div>
                                <div class="space-4"></div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right"> 商品主图 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <div class="col-xs-10 col-sm-5"><input type="file" class="multi_img" name="picture" required>
                                            <img name='pic' id="pic" src='__PUBLIC__/hytn/images/upload.png' style="width:120px;padding-top:10px;">
                                        </div>
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right"> 商品辅图 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <div class="col-xs-10 col-sm-2"><input type="file" class="multi_img" name="assist_picture1" required>
                                            <img name='pic' src='__PUBLIC__/hytn/images/upload.png' style="width:120px;padding-top:10px;">
                                        </div>
                                        <div class="col-xs-10 col-sm-2"><input type="file" class="multi_img" name="assist_picture2" required>
                                            <img name='pic' src='__PUBLIC__/hytn/images/upload.png' style="width:120px;padding-top:10px;">
                                        </div>
                                        <div class="col-xs-10 col-sm-2"><input type="file" class="multi_img" name="assist_picture3" required>
                                            <img name='pic' src='__PUBLIC__/hytn/images/upload.png' style="width:120px;padding-top:10px;">
                                        </div>
                                        <div class="col-xs-10 col-sm-2"><input type="file" class="multi_img" name="assist_picture4" required>
                                            <img name='pic' src='__PUBLIC__/hytn/images/upload.png' style="width:120px;padding-top:10px;">
                                        </div>
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 商品详情 </label>
                                    <div class="col-sm-6">
                                        <script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
                                        <script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script>
                                        <textarea name="desc" rows="100%" style="width:100%" id="myEditor"></textarea>
                                        <script type="text/javascript">
                                            var editor = new UE.ui.Editor();
                                            editor.render("myEditor");
                                        </script>
                                    </div>
                                </div>
                                <div class="col-md-offset-2 col-md-9">
                                    <button class="btn btn-info" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        提交
                                    </button>

                                    &nbsp; &nbsp; &nbsp;
                                    <button class="btn btn-info" type="button" onclick='fan();'>
                                        <i class="icon-ok bigger-110"></i>
                                        返回
                                    </button>
                                </div>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer" />

</div><!-- /.main-container -->

<include file="Public/footerjs" />
<!-- inline scripts related to this page -->
<script type="text/javascript">
    function fan(){
        var urls = "{:U('AdminUser/index')}";
        window.location.href=urls;
    }
</script>

<script>
    //勾选单独安装时，显示/隐藏单独安装费
    $('#alone_install').click(function () {
        if($(this).is(':checked')){
            $('#alone_install_price').css('display','block');
            $('#install_price').attr('required','required');
        }else{
            $('#alone_install_price').css('display','none');
            $('#install_price').removeAttr('required');
        }
    })
</script>
</body>
</html>
